Skip to content

Ingest records immediately when next payload will exceed buffer limit#336

Merged
timacdonald merged 7 commits into1.xfrom
digest-before-when-exceeding-limit
Mar 3, 2026
Merged

Ingest records immediately when next payload will exceed buffer limit#336
timacdonald merged 7 commits into1.xfrom
digest-before-when-exceeding-limit

Conversation

@timacdonald
Copy link
Member

@timacdonald timacdonald commented Mar 2, 2026

We currently ingest records once the buffer reaches the threshold. The problem is we don't account for the incoming payload when deciding when to ingest.

Imagine we have ingested 7mb of data. The threshold is 8mb.

When a 2mb payload comes in, we append it and ingest. This means the payload was 9mb.

With these changes, we check if the incoming payload will put the buffer over the threshold before appending. If it does, we ingest the current buffer and then use the payload as the start of the new buffer.

This will likely cause more ingesting to occur, but it should mean ingest sizes are smaller and we don't hit issues with larger than expected payloads.

@timacdonald timacdonald force-pushed the digest-before-when-exceeding-limit branch from 9d247fa to 29492da Compare March 2, 2026 01:03
timacdonald and others added 5 commits March 2, 2026 12:43
@timacdonald timacdonald enabled auto-merge (squash) March 3, 2026 02:25
@timacdonald timacdonald merged commit 618e0b6 into 1.x Mar 3, 2026
60 of 64 checks passed
@timacdonald timacdonald deleted the digest-before-when-exceeding-limit branch March 3, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants